import React from 'react'
import { Link, Control } from 'react-keeper'
import 'weui';
import fangzi from './../../assets/icon/房子.png';
import { ButtonArea,Panel,PanelHeader,PanelBody,Page,
  Button,
  CellsTitle,
  CellsTips,
  Cell,
  CellHeader,
  CellBody,
  CellFooter,
  Form,
  FormCell,
  Icon,
  Input,
  Label,
  TextArea,
  Switch,
  Radio,
  Checkbox,
  Select,
  VCode,Flex,
  FlexItem,
  MediaBox,
  MediaBoxHeader,
  MediaBoxBody,
  MediaBoxTitle,
  MediaBoxDescription,
  MediaBoxInfo,
  MediaBoxInfoMeta,
  Agreement,
  Toptips
} from  'react-weui/build/packages';
const appMsgIcon = <img
  src=""/>



export default class EngInfo extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
    }
    this.mypreview = this.mypreview.bind(this);
  }

  mypreview() {
    Control.go('/mypreview');
  }

  shouldComponentUpdate(nextProps = {}, nextState = {}) {
    return true;
  }

  render() {
    return (

        <Panel className="head-panel">
          <PanelHeader>
            <div className="title-bg"/>
            参建工程
          </PanelHeader>
          <PanelBody>
            <Flex>
              <FlexItem >
                {
                  this.props.engls.map((item, index) => {
                    return <EngItem eng={item} key={index}/>
                  })
                }
              </FlexItem>
            </Flex>
          </PanelBody>
        </Panel>
    )
  }
}

EngInfo.propTypes = {
  engls: React.PropTypes.object.isRequired,
  imgls: React.PropTypes.object.isRequired
}

class EngItem extends React.Component {
  constructor(props) {
    super(props);
    this.mypreview = this.mypreview.bind(this);
  }

  mypreview() {
    Control.go('/myinfo/engview',this.props.eng);
  }

  render() {
    return (

    <Cell >
      <CellHeader  access link onClick={this.mypreview} style={{position: 'relative', marginRight: '10px'}}>
        <img src={fangzi} alt="" o style={{display: `block`, width: `20px`, marginRight: `5px`}}/>
      </CellHeader>
      <CellBody>
        <p>{this.props.eng.engName}  </p>

        <p style={{fontSize: '13px', color: '#888888'}}>  { this.props.eng.engJsdw }</p>
        <p style={{fontSize: '13px', color: '#888888'}}>{ this.props.eng.engAddress}</p>
      </CellBody>
    </Cell>

  )
  }
}
EngItem.propTypes = {
  eng: React.PropTypes.object.isRequired
}



